// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  // const wxContext = cloud.getWXContext()
  const db = cloud.database()
  db.collection('find_list').add({
    // data 字段表示需新增的 JSON 数据
    data: {
      user_id: event.id,
      garbage_classify:event.classify,
      garbage_name: event.name,
    }
  })
  .then(res => {
    // console.log(res)
  })
  return "ok"
}